import request from '@/utils/request'

export function getInfo(query) {
  return request({
    url: '/bidding/page',
    method: 'get',
    params: query
  })
}

export function add(id) {
  return request({
    url: `/bidding/${id}`,
    method: 'post'
  })
}

export function update(id, data) {
  return request({
    url: `/bidding/${id}`,
    method: 'put',
    data
  })
}

export function cancel(id, data) {
  return request({
    url: `/bidding/cancel/${id}`,
    method: 'put',
    data
  })
}

export function getFileInfo(projectId) {
  return request({
    url: `/bidding/file/${projectId}`,
    method: 'get'
  })
}
export function getFileInfo1(projectId, params) {
  return request({
    url: `/bidding/file/${projectId}`,
    method: 'get',
    params: params
  })
}
export function getFileInfo2(projectId, params) {
  return request({
    url: `/project/file/${projectId}`,
    method: 'get',
    params: params
  })
}
export function uploadFile(id, file) {
  return request({
    url: `/bidding/uploadFile/${id}`,
    method: 'post',
    data: file
  })
}

export function uploadFileCancel(id) {
  return request({
    url: `/bidding/uploadFile/cancel/${id}`,
    method: 'put'
  })
}

export function downFile(id) {
  return request({
    url: `/bidding/downloadFile/${id}`,
    method: 'get'
  })
}

export function win(id) {
  return request({
    url: `/bidding/win/${id}`,
    method: 'put'
  })
}

export function cancelWin(id) {
  return request({
    url: `/bidding/cancelWin/${id}`,
    method: 'put'
  })
}

export function getBiddingInfo(projectId, supplierId) {
  return request({
    url: `/bidding/${projectId}/${supplierId}`,
    method: 'get'
  })
}
